package cn.net.yato.picture.util;

import org.springframework.transaction.interceptor.TransactionAspectSupport;

/**
 * @ClassName TransactionalUtil
 * @Description TODO
 * @Author yato
 * @Date 2020/2/13 18:08
 * @Version 1.0
 */
public class TransactionalUtil {

    private TransactionalUtil(){

    }

    public static void rollback() {
        try {
            throw new Exception();
        }catch (Exception e){
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            e.printStackTrace();
        }
    }
}
